/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ch.uzh.ifi.seal.ssqa.model.impl;

import ch.uzh.ifi.seal.ssqa.model.ModelPackage;
import ch.uzh.ifi.seal.ssqa.model.TimeTracking;

import java.util.Date;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Time Tracking</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ch.uzh.ifi.seal.ssqa.model.impl.TimeTrackingImpl#getSubmissionDate <em>Submission Date</em>}</li>
 *   <li>{@link ch.uzh.ifi.seal.ssqa.model.impl.TimeTrackingImpl#getEstimationTime <em>Estimation Time</em>}</li>
 *   <li>{@link ch.uzh.ifi.seal.ssqa.model.impl.TimeTrackingImpl#getActualTime <em>Actual Time</em>}</li>
 *   <li>{@link ch.uzh.ifi.seal.ssqa.model.impl.TimeTrackingImpl#getDeadline <em>Deadline</em>}</li>
 *   <li>{@link ch.uzh.ifi.seal.ssqa.model.impl.TimeTrackingImpl#getStartDate <em>Start Date</em>}</li>
 *   <li>{@link ch.uzh.ifi.seal.ssqa.model.impl.TimeTrackingImpl#getEndDate <em>End Date</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class TimeTrackingImpl extends EObjectImpl implements TimeTracking {
	/**
	 * The default value of the '{@link #getSubmissionDate() <em>Submission Date</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSubmissionDate()
	 * @generated
	 * @ordered
	 */
	protected static final Date SUBMISSION_DATE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getSubmissionDate() <em>Submission Date</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSubmissionDate()
	 * @generated
	 * @ordered
	 */
	protected Date submissionDate = SUBMISSION_DATE_EDEFAULT;

	/**
	 * The default value of the '{@link #getEstimationTime() <em>Estimation Time</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEstimationTime()
	 * @generated
	 * @ordered
	 */
	protected static final double ESTIMATION_TIME_EDEFAULT = 0.0;

	/**
	 * The cached value of the '{@link #getEstimationTime() <em>Estimation Time</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEstimationTime()
	 * @generated
	 * @ordered
	 */
	protected double estimationTime = ESTIMATION_TIME_EDEFAULT;

	/**
	 * The default value of the '{@link #getActualTime() <em>Actual Time</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActualTime()
	 * @generated
	 * @ordered
	 */
	protected static final double ACTUAL_TIME_EDEFAULT = 0.0;

	/**
	 * The cached value of the '{@link #getActualTime() <em>Actual Time</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActualTime()
	 * @generated
	 * @ordered
	 */
	protected double actualTime = ACTUAL_TIME_EDEFAULT;

	/**
	 * The default value of the '{@link #getDeadline() <em>Deadline</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDeadline()
	 * @generated
	 * @ordered
	 */
	protected static final Date DEADLINE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getDeadline() <em>Deadline</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDeadline()
	 * @generated
	 * @ordered
	 */
	protected Date deadline = DEADLINE_EDEFAULT;

	/**
	 * The default value of the '{@link #getStartDate() <em>Start Date</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStartDate()
	 * @generated
	 * @ordered
	 */
	protected static final Date START_DATE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getStartDate() <em>Start Date</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStartDate()
	 * @generated
	 * @ordered
	 */
	protected Date startDate = START_DATE_EDEFAULT;

	/**
	 * The default value of the '{@link #getEndDate() <em>End Date</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEndDate()
	 * @generated
	 * @ordered
	 */
	protected static final Date END_DATE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getEndDate() <em>End Date</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEndDate()
	 * @generated
	 * @ordered
	 */
	protected Date endDate = END_DATE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected TimeTrackingImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ModelPackage.Literals.TIME_TRACKING;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Date getSubmissionDate() {
		return submissionDate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSubmissionDate(Date newSubmissionDate) {
		Date oldSubmissionDate = submissionDate;
		submissionDate = newSubmissionDate;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.TIME_TRACKING__SUBMISSION_DATE, oldSubmissionDate, submissionDate));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public double getEstimationTime() {
		return estimationTime;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setEstimationTime(double newEstimationTime) {
		double oldEstimationTime = estimationTime;
		estimationTime = newEstimationTime;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.TIME_TRACKING__ESTIMATION_TIME, oldEstimationTime, estimationTime));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public double getActualTime() {
		return actualTime;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setActualTime(double newActualTime) {
		double oldActualTime = actualTime;
		actualTime = newActualTime;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.TIME_TRACKING__ACTUAL_TIME, oldActualTime, actualTime));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Date getDeadline() {
		return deadline;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDeadline(Date newDeadline) {
		Date oldDeadline = deadline;
		deadline = newDeadline;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.TIME_TRACKING__DEADLINE, oldDeadline, deadline));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Date getStartDate() {
		return startDate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setStartDate(Date newStartDate) {
		Date oldStartDate = startDate;
		startDate = newStartDate;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.TIME_TRACKING__START_DATE, oldStartDate, startDate));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Date getEndDate() {
		return endDate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setEndDate(Date newEndDate) {
		Date oldEndDate = endDate;
		endDate = newEndDate;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.TIME_TRACKING__END_DATE, oldEndDate, endDate));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ModelPackage.TIME_TRACKING__SUBMISSION_DATE:
				return getSubmissionDate();
			case ModelPackage.TIME_TRACKING__ESTIMATION_TIME:
				return getEstimationTime();
			case ModelPackage.TIME_TRACKING__ACTUAL_TIME:
				return getActualTime();
			case ModelPackage.TIME_TRACKING__DEADLINE:
				return getDeadline();
			case ModelPackage.TIME_TRACKING__START_DATE:
				return getStartDate();
			case ModelPackage.TIME_TRACKING__END_DATE:
				return getEndDate();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ModelPackage.TIME_TRACKING__SUBMISSION_DATE:
				setSubmissionDate((Date)newValue);
				return;
			case ModelPackage.TIME_TRACKING__ESTIMATION_TIME:
				setEstimationTime((Double)newValue);
				return;
			case ModelPackage.TIME_TRACKING__ACTUAL_TIME:
				setActualTime((Double)newValue);
				return;
			case ModelPackage.TIME_TRACKING__DEADLINE:
				setDeadline((Date)newValue);
				return;
			case ModelPackage.TIME_TRACKING__START_DATE:
				setStartDate((Date)newValue);
				return;
			case ModelPackage.TIME_TRACKING__END_DATE:
				setEndDate((Date)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ModelPackage.TIME_TRACKING__SUBMISSION_DATE:
				setSubmissionDate(SUBMISSION_DATE_EDEFAULT);
				return;
			case ModelPackage.TIME_TRACKING__ESTIMATION_TIME:
				setEstimationTime(ESTIMATION_TIME_EDEFAULT);
				return;
			case ModelPackage.TIME_TRACKING__ACTUAL_TIME:
				setActualTime(ACTUAL_TIME_EDEFAULT);
				return;
			case ModelPackage.TIME_TRACKING__DEADLINE:
				setDeadline(DEADLINE_EDEFAULT);
				return;
			case ModelPackage.TIME_TRACKING__START_DATE:
				setStartDate(START_DATE_EDEFAULT);
				return;
			case ModelPackage.TIME_TRACKING__END_DATE:
				setEndDate(END_DATE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ModelPackage.TIME_TRACKING__SUBMISSION_DATE:
				return SUBMISSION_DATE_EDEFAULT == null ? submissionDate != null : !SUBMISSION_DATE_EDEFAULT.equals(submissionDate);
			case ModelPackage.TIME_TRACKING__ESTIMATION_TIME:
				return estimationTime != ESTIMATION_TIME_EDEFAULT;
			case ModelPackage.TIME_TRACKING__ACTUAL_TIME:
				return actualTime != ACTUAL_TIME_EDEFAULT;
			case ModelPackage.TIME_TRACKING__DEADLINE:
				return DEADLINE_EDEFAULT == null ? deadline != null : !DEADLINE_EDEFAULT.equals(deadline);
			case ModelPackage.TIME_TRACKING__START_DATE:
				return START_DATE_EDEFAULT == null ? startDate != null : !START_DATE_EDEFAULT.equals(startDate);
			case ModelPackage.TIME_TRACKING__END_DATE:
				return END_DATE_EDEFAULT == null ? endDate != null : !END_DATE_EDEFAULT.equals(endDate);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (submissionDate: ");
		result.append(submissionDate);
		result.append(", estimationTime: ");
		result.append(estimationTime);
		result.append(", actualTime: ");
		result.append(actualTime);
		result.append(", deadline: ");
		result.append(deadline);
		result.append(", startDate: ");
		result.append(startDate);
		result.append(", endDate: ");
		result.append(endDate);
		result.append(')');
		return result.toString();
	}

} //TimeTrackingImpl
